tools_k8s__images_pull(){
	##K8S基础镜像
	rm -f /init/image_pull.sh
	mkdir -p /init/
	image_list=`kubeadm config images list | grep -v etcd`
	for i in $image_list;do
		echo -e "docker pull $i" >> /init/image_pull.sh
	done
	sed -i "s#k8s.gcr.io#aiotceo#g" /init/image_pull.sh
	bash /init/image_pull.sh
	image_s=`cat /init/image_pull.sh | wc -l`
	for((i=1;i<=$image_s;i++));do
		old=`cat /init/image_pull.sh | awk '{print $3}' | sed -n ${i}p`
		new=`cat /init/image_pull.sh | awk '{print $3}' | sed -n ${i}p | sed 's/aiotceo/k8s.gcr.io/g'`
		if [[ -n "$old" && -n "$old" ]];then
			docker tag $old $new
			red_z_green_z  '镜像标签重命名:' "[ $old ]--->>[ $new ]" 
			docker rmi $old
		fi
	done		
	docker pull bantianyinshi/etcd:3.4.13-0
	docker tag bantianyinshi/etcd:3.4.13-0 k8s.gcr.io/etcd:3.4.13-0 
	echo "echo -e '镜像标签重命名:[ bantianyinshi/etcd:3.4.13-0 ] --->> [ k8s.gcr.io/etcd:3.4.13-0 ]' " >>  /init/image_pull.sh
	docker rmi bantianyinshi/etcd:3.4.13-0
	##K8S网络[calico]镜像
	rm -f /init/image_calico.sh
	image_list='calico/pod2daemon-flexvol calico/cni calico/node calico/kube-controllers'
	for i in $image_list;do
		echo -e "docker pull $i" >> /init/image_calico.sh
	done
	# tools_k8s__images_push_config "$1"
}
tools_k8s__images_push_config(){
	tools_Dockr_tools_Docker_Private_mirrors "$1"
	if [[ `docker ps -a |grep registry  | awk '{print $2}' | sed 's/:.*//'` == 'registry' ]];then
		green_zt '容器:[ registry ]已存在'
		if [[ `docker ps -a |grep registry | awk '{print $8}'` == 'Up' ]];then
			green_zt '容器: [ registry ]是运行中的'
		else
			docker rm -f registry
			docker run -d -v /data/docker/registry:/var/lib/registry -p 5000:5000 --restart=always --name registry registry:latest
		fi
	else
		docker run -d -v /data/docker/registry:/var/lib/registry -p 5000:5000 --restart=always --name registry registry:latest
	fi
}
if [[ "$1" == 'zgj' ]];then
    bash /init/image_pull.sh
    bash /init/image_calico.sh
fi